package ru.ifmo.filemanager.local;

import static org.eclipse.swt.SWT.FILL;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;

import ru.ifmo.filemanager.core.Core;

public class FileViewer {
	public static void viewFile(String file, String fileName) {
		Composite mainPanel = Core.createTabControl(fileName);
		
		Text text = new Text(mainPanel, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
		{
			text.setLayoutData(new GridData(FILL, FILL, true, true));
		}
		
		text.setText(file);
		text.setEditable(false);		

		/*RowLayout layout = new RowLayout(VERTICAL);
		layout.fill = true;
		layout.wrap = false;*/
		mainPanel.setLayout(new GridLayout());
		//mainPanel.setSize(mainPanel.computeSize( DEFAULT, DEFAULT));		
	}
}
